package com.varian.system.listener;

import com.varian.system.constant.SystemConstant;
import com.varian.system.service.ISysDeptService;
import com.varian.task.annotation.VarianTask;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * @author ben
 * @since 2025/1/19
 */
@Component
@RequiredArgsConstructor
public class DeptTaskListener {

    private final ISysDeptService deptService;

    @VarianTask(SystemConstant.TASK_DEPT_ADD)
    public void add(Long id) {
        deptService.processDeptAddEvent(id);
    }

    @VarianTask(SystemConstant.TASK_DEPT_UPDATE)
    public void update(Long id) {
        deptService.processDeptUpdateEvent(id);
    }
}
